<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>05-遍历数组对象</title>
  </head>

  <body>
    <script>
      let students = [
        { name: '小明', age: 18, gender: '男', hometown: '湖北省' },
        { name: '小红', age: 22, gender: '女', hometown: '广西省' },
        { name: '小张', age: 25, gender: '女', hometown: '湖南省' },
        { name: '小李', age: 28, gender: '男', hometown: '广东省' },
      ]
      for (let i = 0; i < students.length; i++) {
        // console.log(students[i])
        console.log(students[i].gender)
        console.log(students[i].hometown)
        // for (const k in students[i]) {
        //   // console.log('属性名', k)
        //   // console.log('属性值', students[i][k])
        // }
      }
    </script>
  </body>
</html>
